package com.example.demo.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/*
 *
 *   @Author:max
 *   @Date: 2024/3/11-03-11-18:40
 *   手机号注册VO
 */

@Data
public class RegisterByPhoneVO {

    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号必须是11位中国手机号")
    @ApiModelProperty(value = "手机号",required = true)
    private String phone;


    @NotNull(message = "密码不能为空")
    @Length(min = 6,max = 11,message = "密码必须在6-11位")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$", message = "密码必须包含大小写字母和数字")
    @ApiModelProperty(value = "密码",required = true)
    private String password;
}
